const Router = require('@koa/router')
const router = new Router()

router.get('/all', async (ctx) => {
  ctx.body = '所有用户信息'
})

router.get('/page', async (ctx) => {
  ctx.body = '用户分页数据'
})

router.get('/:id', async (ctx) => {
  // ctx.body = `获取用户${ctx.params.id}的用户信息`
  ctx.body = {
    username: 'jxm',
    age: 28,
  }
})

router.prefix('/user')
module.exports = router
